<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			function fn() {
				return new Promise((resolve, reject) => {
					setTimeout(() => {
						var xhr = new XMLHttpRequest();
						xhr.open("get", "https://api.apiopen.top/api/sentences");
						xhr.send();
						xhr.onreadystatechange = function() {
							if (xhr.readyState == 4 && xhr.status == 200) {
								resolve(xhr.responseText);
							}
						}
					}, 3000)
				});
			}

			console.log(fn());

			async function ajax() {
				const r = await fn();
				console.log(r);
			};

			ajax();
		</script>
	</body>
</html>
